<form action="<?=$this->base_url?>save" method="post">
<table border="1" width="600px">
	<tr>
		<td width="10%"><?=$mvc->tr("Name")?></td>
		<td>
			<input type="text" id="username" name="name" value="<?=$this->user->name ?>">
			<input type="button" value="load" onClick="document.location='<?=$this->base_url?>load?name=' + jQuery('#username').val()">
			<input type="button" value="kill" onClick="document.location='<?=$this->base_url?>kill?name=' + jQuery('#username').val()">
		</td>
	</tr>
	<tr>
		<td><?=$mvc->tr("Password")?></td>
		<td><input type="password" name="password" /></td>
	</tr>
	<tr>
		<td><?=$mvc->tr("Inherit")?></td>
		<td>
			<select name="inherits[]" multiple>
				<?
					foreach($this->usernames as $username)
					{
						if (array_search($username, $this->user->config['inherits']) === FALSE)
							echo '<option name="'.$username.'">'.$username.'</option>';
						else
							echo '<option name="'.$username.'" selected>'.$username.'</option>';
					}
				?>
			</select>
			
		</td>
	</tr>	
	<tr>
		<td><?=$mvc->tr("Permissions")?></td>
		<td><textarea name="permissions" style="width:100%; height:200px"><?=implode("\n", $this->user->permissions); ?></textarea></td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" value="<?=$mvc->tr("Save")?>" />
			<input type="submit" value="<?=$mvc->tr("Cancel")?>" />
		</td>
	</tr>
</table>
</form>

<script language="javascript" type="text/javascript"><!--
	jQuery('#username').autocomplete({
		delay: 0,
		minLength: 0,
		source: [
			"<?= implode('","', $this->usernames) ?>"
		],
		select: function(event, ui) { document.location='<?=$this->base_url?>load?name=' + ui.item.value }
	});
--></script>

<a href="<?=$this->base_url?>hallo">hallo</a>